package me.zhengjie.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

@Entity
@Table(name = "fz_files")
@Getter
@Setter
@GenericGenerator(name = "id", strategy = "uuid")
public class ErpFiles implements Serializable {
    /**
     *
     */
    private static final long serialVersionUID = 1L;

    @Id
    private String id;

    private String fileName;

    private String fileType;

    private String fileUrl;

    private Date creationTime;

    private String userName;

    private Long fileSize;

    private String fileMd5;

    private String bId;

    private String rootDir;

    private String fType;

    public void copy(ErpFiles source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }

    public void copyTo(ErpFiles source){
        BeanUtil.copyProperties(this, source, CopyOptions.create().setIgnoreNullValue(true));
    }
}
